//
//  SecondViewController.m
//  ScreenRotateVC
//
//  Created by Liusr on 2017/6/6.
//  Copyright © 2017年 liu. All rights reserved.
//

#import "SecondViewController.h"
#import "FirstView.h"
@interface SecondViewController ()

@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    FirstView *fview = [[FirstView alloc]init];
    fview.backgroundColor = [UIColor blueColor];
    fview.frame = CGRectMake(50, 50, 200, 100);
    [self.view addSubview:fview];
    
    
    UIButton *budis = [[UIButton alloc]initWithFrame:CGRectMake(50, 280, 80, 50)];
    [budis setTitle:@"dismiss" forState:UIControlStateNormal];
    [budis setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [self.view addSubview:budis];
    [budis addTarget:self action:@selector(clickdis) forControlEvents:UIControlEventTouchUpInside];
    
    // Do any additional setup after loading the view.
}

-(void)clickdis{
    [self dismissViewControllerAnimated:YES completion:nil];
}
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
    return UIInterfaceOrientationPortrait;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
